package org.example.feign.fallback;

import lombok.extern.slf4j.Slf4j;
import org.example.bean.Product;
import org.example.feign.ProductFeignClient;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

@Slf4j
@Component
public class ProductFeignClientFallback implements ProductFeignClient {
    @Override
    public Product getProduct(String id, String token) {
        log.info("兜底回调-ProductFeignClientFallback.getProduct()");
        Product product = new Product();
        product.setId("0");
        product.setName("发送接口失败后的兜底返回");
        return product;
    }

    @Override
    public List<Product> getProductList() {
        return null;
    }

    @Override
    public List<Product> getFallbackTest() {
        log.info("兜底回调-ProductFeignClientFallback.getProduct()");
        Product product = new Product();
        product.setId("0");
        product.setName("发送接口失败后的兜底返回");
        return Arrays.asList(product);
    }
}
